package com.example.androidprojecttest;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.PaintDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.view.View;

public class DrawableView extends View {
	
	BitmapDrawable bd;
	
	public DrawableView(Context context) {
		super(context);
		
		bd = (BitmapDrawable)getResources().getDrawable(R.drawable.news);
		bd.setBounds(80, 250, 230, 400);
		
		// TODO Auto-generated constructor stub
	}

	@Override
	protected void onDraw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.onDraw(canvas);
		
		
		Paint paint=new Paint();
		paint.setColor(Color.RED);
		canvas.drawLine(20, 20, 120, 120, paint);
		
		paint.setColor(Color.YELLOW);
		paint.setAlpha(120);
		
		canvas.drawCircle(120, 120, 100, paint);
		
		bd.draw(canvas);
		
	}

}
